function Def = VAR()
% VAR  [Not a public function] Default options for VAR class functions.
%
% Backend IRIS function.
% No help provided.

% -IRIS Toolbox.
% -Copyright (c) 2007-2014 IRIS Solutions Team.

%--------------------------------------------------------------------------

Def = struct();

outputFmt = { ...
    'output','auto',@(x) any(strcmpi(x,{'auto','dbase','tseries','array'})), ...
    };

applyFilter = { ...
    'applyto',Inf,@(x) isnumeric(x) || islogical(x) || isequal(x,':') || iscellstr(x), ...
    'filter','',@ischar, ...
    };

tolerance = { ...
    'tolerance',getrealsmall(),@is.numericscalar, ...
    };

output = { ...
    'output','namedmat',@(x) ischar(x) && any(strcmpi(x,{'namedmat','numeric'})), ...
    };

Def.acf = { ...
    applyFilter{:}, ...
    output{:}, ...
    'nfreq',256,@is.numericscalar, ...
    'order',0,@is.numericscalar, ...
    'progress',false,@is.logicalscalar, ...
    }; %#ok<*CCAT>

Def.demean = { ...
   };

Def.estimate = [ ...
    outputFmt, { ...
    'a',[],@isnumeric, ...
    'bvar',[],@(x) isempty(x) || isa(x,'BVAR.bvarobj'), ...
    'c',[],@isnumeric, ...
    'diff',false,@is.logicalscalar, ...
    'g',[],@isnumeric, ...
    'order',1,@(x) isnumeric(x) && numel(1) == 1, ...
    'cointeg',[],@isnumeric, ...
    'comment','',@(x) ischar(x) || isequal(x,Inf), ...
    'constraints,constraint','',@(x) ischar(x) || isnumeric(x), ...
    'constant,const,constants',true,@is.logicalscalar, ...
    'covparameters,covparameter',false,@is.logicalscalar, ...
    'eqtnbyeqtn',false,@is.logicalscalar, ...
    'maxiter',1,@is.numericscalar, ...
    'mean',[],@(x) isempty(x) || isnumeric(x), ...
    'progress',false,@is.logicalscalar, ...
    'schur',true,@is.logicalscalar, ...
    'stdize',false,@is.logicalscalar, ...
    'tolerance',1e-5,@is.numericscalar, ...
    'timeweights',[],@(x) isempty(x) || isa(x,'tseries'), ...
    'ynames,yname',{},@iscellstr, ...
    'enames,ename',{},@iscellstr, ...
    'warning',true,@is.logicalscalar, ...
    ...
    'fixedeffect',false,@is.logicalscalar, ...
    'groupweights',[],@(x) isempty(x) || isnumeric(x), ...
    }];

Def.filter = { ...
    'ahead',1,@(x) isnumeric(x) || x == round(x) || x >= 1, ...
    'cross',true,@(x) is.logicalscalar(x) || (is.numericscalar(x) && x >=0 && x <= 1), ...
    'deviation,deviations',false,@is.logicalscalar, ...
    'meanonly',false,@is.logicalscalar, ...
    'omega',[],@isnumeric, ...
    'output','smooth',@ischar, ...    
    };

Def.fmse = { ...
    output{:}, ...
    }; %#ok<CCAT1>

Def.forecast = { ...
    outputFmt{:},  ...
    'cross',true,@(x) is.logicalscalar(x) || (is.numericscalar(x) && x >=0 && x <= 1), ...
    'dboverlay,dbextend',false,@is.logicalscalar, ...
    'deviation,deviations',false,@is.logicalscalar, ...
    'meanonly',false,@is.logicalscalar, ...
    'omega',[],@isnumeric, ...
    'returninstruments,returninstrument',true,@is.logicalscalar, ...
    'returnresiduals,returnresidual',true,@is.logicalscalar, ...
    };

Def.integrate = { ...
    'applyto',Inf,@(x) isnumeric(x) || islogical(x), ...
    };

Def.isexplosive = [ ...
    tolerance, ...
    ];

Def.isstationary = [ ...
    tolerance, ...
    ];


Def.portest = { ...
    'level',0.05,@(x) is.numericscalar(x) && x > 0 && x < 1, ...
    };

Def.resample = { ...
    outputFmt{:}, ...
    'deviation,deviations',false,@is.logicalscalar, ...   
    'method','montecarlo',@(x) is.func(x) ...
    || (ischar(x) && any(strcmpi(x,{'montecarlo','bootstrap'}))), ...
    'progress',false,@is.logicalscalar, ...
    'randomise,randomize',false,@is.logicalscalar, ...
    'wild',false,@is.logicalscalar, ...
    };

Def.simulate = { ...
    outputFmt{:}, ...
    'contributions,contribution',false,@is.logicalscalar, ...
    'deviation,deviations',false,@is.logicalscalar, ...
    'returnresiduals,returnresidual',true,@is.logicalscalar, ...
    };

Def.sprintf = { ...
    'constant,constants,const',true,@is.logicalscalar, ...
    'decimal',[], @(x) isempty(x) || is.numericscalar(x), ...
    'declare',false,@is.logicalscalar, ...
    'enames,ename',[],@(x) isempty(x) || iscellstr(x) || is.func(x), ...
    'format','%+.16g',@ischar, ...
    'hardparameters,hardparameter',true,@is.logicalscalar, ...
    'tolerance',getrealsmall(),@is.numericscalar, ...
    'ynames,yname',[],@(x) isempty(x) || iscellstr(x), ...
    };

Def.response = { ...
    'presample',false,@is.logicalscalar, ...
    'select',Inf,@(x) isequal(x,Inf) || islogical(x) || isnumeric(x) || ischar(x) || iscellstr(x), ...
    };

Def.VAR = { ...
    'userdata',[],true, ...
    };

Def.xsf = { ...
    applyFilter{:}, ...
    'progress',false,@is.logicalscalar, ...
    };

end